<template>
  <div>
    <div class="p-4">
      <div class="row">
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">申请公司：</div>
            <div class="dl-dd">{{ infoData.enterprise_name }}</div>
          </div>
        </div>
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">营业执照：</div>
            <div class="dl-dd">{{ infoData.enterprise_code }}</div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">联系人：</div>
            <div class="dl-dd">{{ infoData.agent_name }}</div>
          </div>
        </div>
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">联系电话：</div>
            <div class="dl-dd">{{ infoData.agent_phone }}</div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">标段编号：</div>
            <div class="dl-dd">
              {{ infoData.section_code }}
              <span v-if="infoData.section_name" class="text-muted">
                ({{ infoData.section_name }})
              </span>
            </div>
          </div>
        </div>
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">担保金额：</div>
            <div class="dl-dd">{{ infoData.tender_bond }} 元</div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">保函编号：</div>
            <div class="dl-dd">{{ infoData.guarantee_no }}</div>
          </div>
        </div>
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">发函时间：</div>
            <div class="dl-dd">{{ $utils.dateFormat(infoData.pay_time) }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    queryId: String,
  },
  data() {
    return {
      loading: false,
      infoData: {},
      tableName: 'guarantee_project',
    }
  },
  computed: {},
  watch: {
    queryId: {
      handler: function () {
        this.getData()
      },
      immediate: true,
    },
  },
  created() {},
  mounted() {},
  methods: {
    getData() {
      if (!this.queryId) {
        return
      }
      this.loading = true
      this.$api
        .getDataFromId(this.$serviceName, this.tableName, this.queryId)
        .then(res => {
          this.infoData = res?.data ?? {}
        })
        .finally(() => {
          this.loading = false
        })
    },
  },
}
</script>

<style lang="scss" scoped></style>
